<?php
require_once "../database/mysql.class.php";
//DAO对象，对数据库操作
//对应用户表，用户的增删改查

class userdao{
	
// 	private $user_id;
// 	private $user_name;
// 	private $user_password;
// 	private $user_qq;
	private $db;
// 	private $rs;
	public function __construct(){
		$this->db=new mysql();
// 		$this->rs=[];
	}
	
	public function query($userid=null,$password=null){
		
		if(!empty($userid) && !empty($password)){
			
			//查询用户名密码是否存在，用于登录
			$sql="select *from manager where mno='{$userid}' and pwd='{$password}';";
			return $this->db->query($sql);
			
		}
		else if(empty($userid) && empty($password)){
			//查询所有用户
			$sql="select *from manager ;";
			return $this->db->query($sql);			
			
		}
		else if(!empty($userid) && empty($password)){
			
			//查某个用户是否存在
			$sql="select *from manager where  mno='{$userid}';";
			return $this->db->query($sql);
			
		}else{
			
		}
	}
	

	public function update(){
		
	}
	
	public function insert(){
		
	}
	
	public function del(){
		
	}
}
?>